const path = require('path')
const ora = require('ora')
const chalk = require('chalk')

/**
 * 与当前路径合并计算
 * @param {String} dir
 */
exports.resolve = function(dir) {
  return path.join(`${ process.cwd() }\\`, dir)
}

exports.exit = function(msg) {
  console.log(msg)
  process.exit(1)
}

// 成功信息
exports.succeed = function(...message) {
  ora().succeed(chalk.greenBright.bold(message))
}
// 提示信息
exports.info = function(...message) {
  ora().info(chalk.blueBright.bold(message))
}
// 错误信息
exports.error = function(...message) {
  ora().fail(chalk.redBright.bold(message))
}
// 下划线重点信息
exports.underline = function(message) {
  return chalk.underline.blueBright.bold(message)
}
